<?php
// $mysqli = new mysqli('localhost:3306','liuboyto_root','#MySQLmima#618','liuboyto_618');
header("Content-type:text/html; charset=utf-8");
$mysqli = new mysqli('localhost:3306','root','','boke');
mysqli_query($mysqli,"set names utf8");
$sql = "select * from liuyan,user where liuyan.userid=user.id order by time desc limit 0,2 ";

$res = $mysqli->query($sql);
$a = array();
while ($row = $res->fetch_assoc()) {
	$a[]= $row;
	// $a=$row;
	  // echo(json_encode($a));
	  // print_r($a);
	// print_r($row) ;
}
	  echo(json_encode($a));

$mysqli->close();

?>